package com.atstudent.gmall.product.controller;

import com.atstudent.gmall.common.result.Result;
import com.atstudent.gmall.product.entity.BaseCategory1;
import com.atstudent.gmall.product.service.BaseCategory1Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 查询一级分类接口
 * @Dexcription
 * @Author 薛有朋
 * @CreatDate 2024/11/15 12:31
 **/
 //每次开发东西先去pull代码 保证代码最新
@RestController
@RequestMapping(value = "/admin/product")
public class BaseCategory1Controller {

    @Autowired
    private BaseCategory1Service baseCategory1Service;


    /**
     * 查询一级分类接口
     * @Description
     * @Author 薛有朋
     * @Date 2024/11/23 16:03
     **/
    @GetMapping(value = "/getCategory1")
    public Result<List<BaseCategory1>> findOne(){
        List<BaseCategory1> baseCategory1List = baseCategory1Service.findAllBaseCategory1();
        return Result.ok(baseCategory1List);
    }

}
